<nav aria-label="Admin">
  <ul class="m-0">
    <li>
      <a class="c-link c-link--block c-link--icon-left" href="<%= admin_path %>" aria-current="<%= "page" if controller.controller_name == "overview" %>">
        <%= crayons_icon_tag("stack-line", class: "c-link__icon") %>
        Overview
      </a>
    </li>

    <% menu_items.each do |group_name, group| %>
      <li>
        <a
          class="c-link c-link--block c-link--icon-left <%= "c-link--current mb-1" if current?(request, group, group_name) %>"
          aria-current="<%= "page" if current?(request, group, group_name) && !group.has_multiple_children? %>"
          href="<%= nav_path(group, group_name) %>">
          <%= crayons_icon_tag(group.svg, class: "c-link__icon", aria_hidden: true) %>
          <%= display_name(group_name) %>
        </a>
        <% if group.has_multiple_children? %>
          <ul class="ml-6 mb-1 <%= current?(request, group, group_name) ? "block" : "hidden" %>">
            <% group.children.each do |item| %>
              <% if item.visible %>
                <li>
                  <a
                    class="c-link c-link--block"
                    href="<%= admin_path %>/<%= group_name %>/<%= item.controller %>"
                    <% if sidebar_item_active?(item) %>
                      style="--bg: transparent"
                      aria-current="page"
                    <% end %>>
                    <%= item.name.to_s.titleize %>
                    <% if item.controller.to_s == "gdpr_delete_requests" %>
                      <% if GDPRDeleteRequest.any? %>
                        &nbsp;<span class="c-indicator c-indicator--info fs-xs"><%= GDPRDeleteRequest.count %></span>
                      <% end %>
                    <% end %>
                  </a>
                </li>
              <% end %>
            <% end %>
          </ul>
        <% end %>
      </li>
    <% end %>
  </ul>
</nav>
